API Manager API

(4 reviews)

Getting Started

To manage an API you must register either a proxy or a basic endpoint with API Management capabilities (Mule application).

e31d4120-API Manager endpoints - Page 1.png

To create a proxy for the implementation, perform a request similar to the following example:

curl -X POST \
  https://anypoint.mulesoft.com/apimanager/api/v1/organizations/:organizationId/environments/:environmentId/apis \
  -H 'authorization: Bearer OMITTED' \
  -H 'content-type: application/json' \
  -d '{
   "endpoint":{
      "type": "raml",
      "uri": "http://www.flights-implementation.com",
      "proxyUri": "http://0.0.0.0:8081/",
      "isCloudHub": true,
      "referencesUserDomain": false,
      "responseTimeout": null,
   },
   "technology": "mule4",
   "instanceLabel": "Flights API Instance",
   "spec":{
      "assetId": "flights-api",
      "version": "1.0.0",
      "groupId": "4a744fa6-5fcc-495e-af36-96b8c78c522e"
   }
}'

To register a basic endpoint, make a request similar to the following:

curl -X POST \
  https://anypoint.mulesoft.com/apimanager/api/v1/organizations/:organizationId/environments/:environmentId/apis \
  -H 'authorization: Bearer OMITTED' \
  -H 'content-type: application/json' \
  -d '{
   "endpoint":{
      "uri": "https://www.users-implementation.com",
      "proxyUri": null,
      "isCloudHub": false
   },
   "technology": "mule4",
   "instanceLabel": "Users API Instance",
   "spec":{
      "assetId": "users-api",
      "version": "1.0.0",
      "groupId": "4a744fa6-5fcc-495e-af36-96b8c78c522e"
   }
}'

API Instance Source

The API Instance can be registered from different sources. The examples above use Spec as source. In these examples, the API instance is created from an API Specification defined in Exchange. Every asset in Exchange has the following properties:

  • Group Id
  • Asset Id
  • Version

See the section Promoting an API for information on how to use a different source.

Endpoint

Every API instance contains an endpoint configuration. The endpoint configuration has the following properties:

  • uri: required for proxy instances. Contains the implementation URI.
  • proxyUri: required for proxy instances. Specifies the URI where the proxy runs in the runtime. For CloudHub deployments, the port should be 8081. For standalone or hybrid deployments, you can modify the port.
  • referencesUserDomain: specifies a flag to indicate that it is valid for non-CloudHub deployment to share a domain. For more information, see [API Gateway] Domain(https://docs.mulesoft.com/api-manager/api-gateway-domain).
  • reponseTimeout: specifies the time that the proxy expects an answer from the backend before closing the connection and returning a timeout.
  • technology: Enumerated value that indicates the runtime technology to be used. E.g. "mule4" or "flexGateway".

API Instance Metadata

Apart from a source and an endpoint configuration, each instance has a label. This attribute is optional but is used across Anypoint Platform to identify the instance.

API Manager Endpoints required scopes

The scopes for Connected Apps mentioned in the endpoints are the minimun required. For more information about permissions, see Managing Permissions.


Reviews